Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set an executable page at the top of the stack #433

Closed
wants to merge 1 commit into from

Conversation

mohanson
Copy link
Collaborator

@mohanson mohanson commented May 17, 2024

When this feature is enabled, the top of the stack will be marked as an executable memory page. If the heap or stack attempts to write data to this area, ckb-vm will return an error due to the wxorx rules.

The purpose of this feature is to use it in dapp's testcase, which can reduce the occurrence of overlap.

Note that we have several test cases that use too much heap, which will trigger overlap checks.

@XuJiandong
Copy link
Collaborator

The position should be at symbol "_end": https://man7.org/linux/man-pages/man3/end.3.html
Since we don't use brk the "_end" can be treated as end of stack.

@mohanson
Copy link
Collaborator Author

The method you mentioned is the same as the ckb-vm-pprof https://github.com/nervosnetwork/ckb-standalone-debugger/blob/develop/ckb-vm-pprof/src/lib.rs#L217-L221

You can use PProfMachine directly without adding the same functionality to the ckb-vm project.

@mohanson mohanson closed this May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants